<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		
		
		<script src="https://cdn.jsdelivr.net/npm/vue@2/dist/vue.js"></script>
		<script src="https://unpkg.com/vue-router/dist/vue-router.js"></script>
		<script src="vue.min.js"></script>
		<script>
			import Vue from 'vue'
			import Router from 'vue-router'
			import Home from '@/components/Home'
			import Login from '@/components/Login'
			
			Vue.use(Router)
			
			const router = new Router({
				routes:[
					{
						path:'/',
						name:'Home',
						component:Home
					},
					{
						path:'/login',
						name:'Login',
						component:Login,
						//路由独享守卫
						beforeEnter:(to,from,next) => {
							console.log('登录页面')
							next()
						}
					}
				]
			})
			
			export default router
		</script>
	</body>
</html>
